package com.jiaai.web.zfp_back.system;

import com.alibaba.dubbo.config.annotation.Reference;
import com.jiaai.pay.IPayTxInterfaceApi;
import com.jiaai.pay.entitiy.PayTxInVO;
import com.jiaai.util.RestResultGenerator;
import org.springframework.web.bind.annotation.*;

/**
 * class_name:ZBPayTxInterfaceController
 * describe:------------------>TODO
 * create_user:张昉平
 * create_date:2018/1/19
 * create_time:13:42
 */
@RestController
@RequestMapping("/api/v1/admin/payTx")
public class ZBPayTxInterfaceController {

    @Reference
    private IPayTxInterfaceApi api;

    @GetMapping("/list")
    public Object list(@RequestParam Integer curr){
        return RestResultGenerator.genSuccessResult(api.getAll(curr));
    }

    @PostMapping("/saveOrEdit")
    public Object saveOrEdit(@RequestBody PayTxInVO payTxInVO){
        api.saveOrEdit(payTxInVO);
        return RestResultGenerator.genSuccessResult("操作成功");
    }

    @PostMapping("/delete/{id}")
    public Object delete(@PathVariable Integer id){
        api.delete(id);
        return RestResultGenerator.genSuccessResult("操作成功");
    }
//    @GetMapping("change")
}
